Skip to content

bpo-41316: Make tarfile follow specs for FNAME#21511

Merged
miss-islington merged 6 commits intopython:masterfrom
ArtemSBulgakov:bpo-41316
Sep 7, 2020
Merged

bpo-41316: Make tarfile follow specs for FNAME#21511
miss-islington merged 6 commits intopython:masterfrom
ArtemSBulgakov:bpo-41316

Conversation

@ArtemSBulgakov
Copy link
Contributor

@ArtemSBulgakov ArtemSBulgakov commented Jul 16, 2020

tarfile writes full path to FNAME field of GZIP format instead of just basename if user specified absolute path. Some archive viewers may process file incorrectly. Also it creates security issue because anyone can know structure of directories on system and know username or other personal information.

RFC1952 says about FNAME:
This is the original name of the file being compressed, with any directory components removed.

So tarfile must remove directory names from FNAME and write only basename of file.

https://bugs.python.org/issue41316

Automerge-Triggered-By: @jaraco

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants